/* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Iotlink-Related-API
物联网卡服务相关API

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/

#import <Foundation/Foundation.h>
#import <JDCloudOCSDKIotlink/IotlinkApiModel.h>


@implementation IotlinkOpenIotFlowRequest
-(id) initWithRegion:(NSString *)regionId
iccids:(NSArray<NSString*>*)iccids { 
    self.regionId = regionId;
    self.iccids = iccids;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
iccids:(NSArray<NSString*>*)iccids { 
    self.regionId = regionId;
    self.version = version;
    self.iccids = iccids;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self iccids])
    {
        [result setValue:[self iccids] forKey:@"iccids"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.iccids = [dictionary objectForKey:@"iccids"];
    return self;
} 

@end
@implementation IotlinkOnOffStatusRequest
-(id) initWithRegion:(NSString *)regionId
iccid:(NSString*)iccid { 
    self.regionId = regionId;
    self.iccid = iccid;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
iccid:(NSString*)iccid { 
    self.regionId = regionId;
    self.version = version;
    self.iccid = iccid;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self iccid])
    {
        [result setValue:[self iccid] forKey:@"iccid"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.iccid = [dictionary objectForKey:@"iccid"];
    return self;
} 

@end
@implementation IotlinkCloseIotCardRequest
-(id) initWithRegion:(NSString *)regionId
iccids:(NSArray<NSString*>*)iccids { 
    self.regionId = regionId;
    self.iccids = iccids;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
iccids:(NSArray<NSString*>*)iccids { 
    self.regionId = regionId;
    self.version = version;
    self.iccids = iccids;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self iccids])
    {
        [result setValue:[self iccids] forKey:@"iccids"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.iccids = [dictionary objectForKey:@"iccids"];
    return self;
} 

@end
@implementation IotlinkOpenIotCardRequest
-(id) initWithRegion:(NSString *)regionId
iccids:(NSArray<NSString*>*)iccids { 
    self.regionId = regionId;
    self.iccids = iccids;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
iccids:(NSArray<NSString*>*)iccids { 
    self.regionId = regionId;
    self.version = version;
    self.iccids = iccids;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self iccids])
    {
        [result setValue:[self iccids] forKey:@"iccids"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.iccids = [dictionary objectForKey:@"iccids"];
    return self;
} 

@end
@implementation IotlinkLifeStatusRequest
-(id) initWithRegion:(NSString *)regionId
iccid:(NSString*)iccid { 
    self.regionId = regionId;
    self.iccid = iccid;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
iccid:(NSString*)iccid { 
    self.regionId = regionId;
    self.version = version;
    self.iccid = iccid;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self iccid])
    {
        [result setValue:[self iccid] forKey:@"iccid"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.iccid = [dictionary objectForKey:@"iccid"];
    return self;
} 

@end
@implementation IotlinkCloseIotFlowRequest
-(id) initWithRegion:(NSString *)regionId
iccids:(NSArray<NSString*>*)iccids { 
    self.regionId = regionId;
    self.iccids = iccids;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
iccids:(NSArray<NSString*>*)iccids { 
    self.regionId = regionId;
    self.version = version;
    self.iccids = iccids;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self iccids])
    {
        [result setValue:[self iccids] forKey:@"iccids"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.iccids = [dictionary objectForKey:@"iccids"];
    return self;
} 

@end
@implementation IotlinkGprsRealtimeInfoRequest
-(id) initWithRegion:(NSString *)regionId
iccid:(NSString*)iccid { 
    self.regionId = regionId;
    self.iccid = iccid;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
iccid:(NSString*)iccid { 
    self.regionId = regionId;
    self.version = version;
    self.iccid = iccid;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self iccid])
    {
        [result setValue:[self iccid] forKey:@"iccid"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.iccid = [dictionary objectForKey:@"iccid"];
    return self;
} 

@end
@implementation IotlinkGprsStatusRequest
-(id) initWithRegion:(NSString *)regionId
iccid:(NSString*)iccid { 
    self.regionId = regionId;
    self.iccid = iccid;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
iccid:(NSString*)iccid { 
    self.regionId = regionId;
    self.version = version;
    self.iccid = iccid;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self iccid])
    {
        [result setValue:[self iccid] forKey:@"iccid"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.iccid = [dictionary objectForKey:@"iccid"];
    return self;
} 

@end
@implementation IotlinkCloseIotCardResult
-(id) initWithStatus:(NSString*) status
        message:(NSString*)message
        result:(NSArray<OperationIotlinkResp*>*)result { 
    self.status = status;               
    self.message = message;               
    self.result = result;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    if([self result])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self result] count]; i++) {
            OperationIotlinkResp* item = [[self result] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"result"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.status = [dictionary objectForKey:@"status"];
    self.message = [dictionary objectForKey:@"message"];
    NSArray* resultArray = [dictionary objectForKey:@"result"];
    if(resultArray&&![resultArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [resultArray count];i++)
        {
        OperationIotlinkResp* item = [[OperationIotlinkResp alloc]initWithDic:[resultArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.result = propertyArray;
    }
    return self;
} 

@end
  
@implementation IotlinkCloseIotCardResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
IotlinkCloseIotCardResult* result = [[IotlinkCloseIotCardResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(IotlinkCloseIotCardResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation IotlinkCloseIotFlowResult
-(id) initWithStatus:(NSString*) status
        message:(NSString*)message
        result:(NSArray<OperationIotlinkResp*>*)result { 
    self.status = status;               
    self.message = message;               
    self.result = result;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    if([self result])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self result] count]; i++) {
            OperationIotlinkResp* item = [[self result] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"result"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.status = [dictionary objectForKey:@"status"];
    self.message = [dictionary objectForKey:@"message"];
    NSArray* resultArray = [dictionary objectForKey:@"result"];
    if(resultArray&&![resultArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [resultArray count];i++)
        {
        OperationIotlinkResp* item = [[OperationIotlinkResp alloc]initWithDic:[resultArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.result = propertyArray;
    }
    return self;
} 

@end
  
@implementation IotlinkCloseIotFlowResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
IotlinkCloseIotFlowResult* result = [[IotlinkCloseIotFlowResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(IotlinkCloseIotFlowResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation IotlinkOpenIotCardResult
-(id) initWithStatus:(NSString*) status
        message:(NSString*)message
        result:(NSArray<OperationIotlinkResp*>*)result { 
    self.status = status;               
    self.message = message;               
    self.result = result;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    if([self result])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self result] count]; i++) {
            OperationIotlinkResp* item = [[self result] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"result"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.status = [dictionary objectForKey:@"status"];
    self.message = [dictionary objectForKey:@"message"];
    NSArray* resultArray = [dictionary objectForKey:@"result"];
    if(resultArray&&![resultArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [resultArray count];i++)
        {
        OperationIotlinkResp* item = [[OperationIotlinkResp alloc]initWithDic:[resultArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.result = propertyArray;
    }
    return self;
} 

@end
@implementation IotlinkGprsRealtimeInfoResult
-(id) initWithStatus:(NSString*) status
        message:(NSString*)message
        result:(GprsRealtimeInfoResp*)result { 
    self.status = status;               
    self.message = message;               
    self.result = result;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    if([self result])
    {
        [result setValue:[[self result] dictionary]forKey:@"result"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.status = [dictionary objectForKey:@"status"];
    self.message = [dictionary objectForKey:@"message"];
    self.result = [[GprsRealtimeInfoResp alloc]initWithDic:[dictionary objectForKey:@"result"]];
    return self;
} 

@end
@implementation IotlinkLifeStatusResult
-(id) initWithStatus:(NSString*) status
        message:(NSString*)message
        result:(LifeStatusResp*)result { 
    self.status = status;               
    self.message = message;               
    self.result = result;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    if([self result])
    {
        [result setValue:[[self result] dictionary]forKey:@"result"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.status = [dictionary objectForKey:@"status"];
    self.message = [dictionary objectForKey:@"message"];
    self.result = [[LifeStatusResp alloc]initWithDic:[dictionary objectForKey:@"result"]];
    return self;
} 

@end
  
@implementation IotlinkLifeStatusResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
IotlinkLifeStatusResult* result = [[IotlinkLifeStatusResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(IotlinkLifeStatusResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation IotlinkGprsStatusResult
-(id) initWithStatus:(NSString*) status
        message:(NSString*)message
        result:(GprsStatusResp*)result { 
    self.status = status;               
    self.message = message;               
    self.result = result;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    if([self result])
    {
        [result setValue:[[self result] dictionary]forKey:@"result"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.status = [dictionary objectForKey:@"status"];
    self.message = [dictionary objectForKey:@"message"];
    self.result = [[GprsStatusResp alloc]initWithDic:[dictionary objectForKey:@"result"]];
    return self;
} 

@end
  
@implementation IotlinkGprsStatusResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
IotlinkGprsStatusResult* result = [[IotlinkGprsStatusResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(IotlinkGprsStatusResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation IotlinkOnOffStatusResult
-(id) initWithStatus:(NSString*) status
        message:(NSString*)message
        result:(OnOffStatusResp*)result { 
    self.status = status;               
    self.message = message;               
    self.result = result;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    if([self result])
    {
        [result setValue:[[self result] dictionary]forKey:@"result"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.status = [dictionary objectForKey:@"status"];
    self.message = [dictionary objectForKey:@"message"];
    self.result = [[OnOffStatusResp alloc]initWithDic:[dictionary objectForKey:@"result"]];
    return self;
} 

@end
  
@implementation IotlinkOnOffStatusResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
IotlinkOnOffStatusResult* result = [[IotlinkOnOffStatusResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(IotlinkOnOffStatusResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation IotlinkGprsRealtimeInfoResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
IotlinkGprsRealtimeInfoResult* result = [[IotlinkGprsRealtimeInfoResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(IotlinkGprsRealtimeInfoResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation IotlinkOpenIotCardResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
IotlinkOpenIotCardResult* result = [[IotlinkOpenIotCardResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(IotlinkOpenIotCardResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation IotlinkOpenIotFlowResult
-(id) initWithStatus:(NSString*) status
        message:(NSString*)message
        result:(NSArray<OperationIotlinkResp*>*)result { 
    self.status = status;               
    self.message = message;               
    self.result = result;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    if([self result])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self result] count]; i++) {
            OperationIotlinkResp* item = [[self result] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"result"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.status = [dictionary objectForKey:@"status"];
    self.message = [dictionary objectForKey:@"message"];
    NSArray* resultArray = [dictionary objectForKey:@"result"];
    if(resultArray&&![resultArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [resultArray count];i++)
        {
        OperationIotlinkResp* item = [[OperationIotlinkResp alloc]initWithDic:[resultArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.result = propertyArray;
    }
    return self;
} 

@end
  
@implementation IotlinkOpenIotFlowResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
IotlinkOpenIotFlowResult* result = [[IotlinkOpenIotFlowResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(IotlinkOpenIotFlowResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
 
